home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / present_.swf / scripts / frame_52 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  1.2 KB  |  60 lines

  1. function restartLevel()
  2. {
  3.    _root.gotoAndPlay("level" + currentLevel);
  4. }
  5. function nextLevel()
  6. {
  7.    _root.clock.stopClock();
  8.    if(currentLevel < lastLevel)
  9.    {
  10.       _root.nextLevelWindow.showWindow();
  11.    }
  12.    else
  13.    {
  14.       _root.endWindow.showWindow();
  15.    }
  16. }
  17. function gotoNextLevel()
  18. {
  19.    stopAllSounds();
  20.    _root.gotoAndPlay("level" + (currentLevel + 1));
  21. }
  22. function addGround(target)
  23. {
  24.    grounds.push(target);
  25. }
  26. function addBarrier(target)
  27. {
  28.    barriers.push(target);
  29. }
  30. function checkGrounds()
  31. {
  32.    var _loc2_ = 0;
  33.    while(_loc2_ < grounds.length)
  34.    {
  35.       if(grounds[_loc2_].hit.hitTest(_root.kopter._x,_root.kopter._y,true))
  36.       {
  37.          landingGround = grounds[_loc2_];
  38.          landingGround.activate();
  39.          return true;
  40.       }
  41.       _loc2_ = _loc2_ + 1;
  42.    }
  43.    return false;
  44. }
  45. function checkBarriers(myAlt)
  46. {
  47.    var _loc2_ = 0;
  48.    while(_loc2_ < barriers.length)
  49.    {
  50.       if(barriers[_loc2_].hit.hitTest(_root.kopter._x,_root.kopter._y,true) and barriers[_loc2_].alt >= myAlt)
  51.       {
  52.          return true;
  53.       }
  54.       _loc2_ = _loc2_ + 1;
  55.    }
  56.    return false;
  57. }
  58. extraAnim = true;
  59. lastLevel = 4;
  60.